package com.byxy.ssm.demo.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import com.byxy.ssm.demo.VO.TipVO;
import com.byxy.ssm.demo.service.TipService;

@Controller
public class MainController {
	
	@Autowired
	private TipService tipService;
	
	@GetMapping("main")
	private String main(Model module) {
		List<TipVO> tips = tipService.tips();
		module.addAttribute("tips", tips);
		return "main";
	}
	
}
